﻿

Event = function(name, type)
{
    this.name = name;
    this.type = type;
};
Event.TYPE_KEY_EVENT = 0;
Event.TYPE_STB_EVENT = 1;

var KeyEvent = new function()
{
    // "返回" B
    this.BACK_KEY = new Event("Back Key", Event.TYPE_KEY_EVENT);
    // "确认"
    this.OK_KEY = new Event("OK Key", Event.TYPE_KEY_EVENT);
    // "左"
    this.LEFT_KEY = new Event("Left Key", Event.TYPE_KEY_EVENT);
    // "右"
    this.RIGHT_KEY = new Event("Right Key", Event.TYPE_KEY_EVENT);
    // "上"
    this.UP_KEY = new Event("Up Key", Event.TYPE_KEY_EVENT);
    // "下"
    this.DOWN_KEY = new Event("Down Key", Event.TYPE_KEY_EVENT);
    // "上翻页" <
    this.PAGEUP_KEY = new Event("PageUp Key", Event.TYPE_KEY_EVENT);
    // "下翻页" >
    this.PAGEDOWN_KEY = new Event("PageDown Key", Event.TYPE_KEY_EVENT);

    // "数字"
    this.NUMERIC_KEY = new Event("Numeric Key", Event.TYPE_KEY_EVENT);

    this.ZERO_KEY = new Event("Zero Key", Event.TYPE_KEY_EVENT);

    this.ONE_KEY = new Event("One Key", Event.TYPE_KEY_EVENT);

    this.TWO_KEY = new Event("Two Key", Event.TYPE_KEY_EVENT);

    this.THREE_KEY = new Event("Three Key", Event.TYPE_KEY_EVENT);

    this.FOUR_KEY = new Event("Four Key", Event.TYPE_KEY_EVENT);

    this.FIVE_KEY = new Event("Five Key", Event.TYPE_KEY_EVENT);

    this.SIX_KEY = new Event("Six Key", Event.TYPE_KEY_EVENT);

    this.SEVEN_KEY = new Event("Seven Key", Event.TYPE_KEY_EVENT);

    this.EIGHT_KEY = new Event("Eight Key", Event.TYPE_KEY_EVENT);

    this.NINE_KEY = new Event("Nine Key", Event.TYPE_KEY_EVENT);
    // "#,输入法切换" [
    this.POUND_KEY = new Event("Pound Key", Event.TYPE_KEY_EVENT);
    // "*" ]
    this.STAR_KEY = new Event("Star Key", Event.TYPE_KEY_EVENT);

    // "快进" Shift
    this.FFWD_KEY = new Event("FFWD", Event.TYPE_KEY_EVENT);
    // "快退" Ctrl
    this.FBWD_KEY = new Event("FBWD", Event.TYPE_KEY_EVENT);
    // "频道加"
    this.CHANNELUP_KEY = new Event("ChannelUp Key", Event.TYPE_KEY_EVENT);
    // "频道减"
    this.CHANNELDOWN_KEY = new Event("ChannelDown Key", Event.TYPE_KEY_EVENT);
    // "音量加"
    this.VOLUMEUP_KEY = new Event("VolumeUp Key", Event.TYPE_KEY_EVENT);
    // "音量减"
    this.VOLUMEDOWN_KEY = new Event("VolumeDown Key", Event.TYPE_KEY_EVENT);
    // "静音" K
    this.SILENT_KEY = new Event("Silent Key", Event.TYPE_KEY_EVENT);
    // "音轨" D
    this.AUDIOTRACK_KEY = new Event("AudioTrack Key", Event.TYPE_KEY_EVENT);
    // 暂停 `
    this.PAUSEPLAY_KEY = new Event("PausePlay Key", Event.TYPE_KEY_EVENT);
    // 停止
    this.STOP_KEY = new Event("Stop Key", Event.TYPE_KEY_EVENT);
    // "声道" A
    this.AUDIOCHANNEL_KEY = new Event("AudioChannel Key", Event.TYPE_KEY_EVENT);
    // "字幕" P
    this.SUBTITLE_KEY = new Event("Subtitle Key", Event.TYPE_KEY_EVENT);

    // "红色" A
    this.RED_KEY = new Event("Red Key", Event.TYPE_KEY_EVENT);
    // "绿色" S
    this.GREEN_KEY = new Event("Green Key", Event.TYPE_KEY_EVENT);
    // "黄色" D
    this.YELLOW_KEY = new Event("Yellow Key", Event.TYPE_KEY_EVENT);
    // "蓝色" F
    this.BLUE_KEY = new Event("Blue Key", Event.TYPE_KEY_EVENT);
    // "定位"
    this.POSITION_KEY = new Event("Position Key", Event.TYPE_KEY_EVENT);
    // "回切"
    this.SWITCH_KEY = new Event("Switch Key", Event.TYPE_KEY_EVENT);
    // "收藏夹"
    this.FAVOURITE_KEY = new Event("Favourite Key", Event.TYPE_KEY_EVENT);
    // "帮助" [
    this.HELP_KEY = new Event("Help Key", Event.TYPE_KEY_EVENT);

    // "信息" I
    this.INFO_KEY = new Event("Info Key", Event.TYPE_KEY_EVENT);
    // "搜索" T
    this.SEARCH_KEY = new Event("Search Key", Event.TYPE_KEY_EVENT);
    // "Guide" Q
    this.BTV_KEY = new Event("Btv Key", Event.TYPE_KEY_EVENT);
    // "VOD" V
    this.VOD_KEY = new Event("Vod Key", Event.TYPE_KEY_EVENT);
    // "回看"
    this.TVOD_KEY = new Event("TVod Key", Event.TYPE_KEY_EVENT);
    // "通信"
    this.COMM_KEY = new Event("Comm Key", Event.TYPE_KEY_EVENT);
    // "轮播"
    this.NVOD_KEY = new Event("NVod Key", Event.TYPE_KEY_EVENT);
    // "下划线"
    this.UNDERLINE_KEY = new Event("Underline Key", Event.TYPE_KEY_EVENT);

    // "F1"
    this.F1_KEY = new Event("F1 Key", Event.TYPE_KEY_EVENT);
    // "F2"
    this.F2_KEY = new Event("F2 Key", Event.TYPE_KEY_EVENT);
    // "F3"
    this.F3_KEY = new Event("F3 Key", Event.TYPE_KEY_EVENT);
    // "F4"
    this.F4_KEY = new Event("F4 Key", Event.TYPE_KEY_EVENT);
    // 没有映射的按键
    this.NULL_KEY = new Event("Null Key", Event.TYPE_KEY_EVENT);
    // "语音按键"
    this.VOICE_KEY = new Event("Voice Key", Event.TYPE_KEY_EVENT);
    //OPTION键
    this.OPTION_KEY = new Event("OPTION Key", Event.TYPE_KEY_EVENT);
    //快速切换
    this.KEYLAST_KEY = new Event("KEYLAST_KEY", Event.TYPE_KEY_EVENT);
    //PIP
    this.PIP_KEY = new Event("PIP_KEY", Event.TYPE_KEY_EVENT);
    //四屏同看
    this.MULTIVIEW_KEY = new Event("MULTIVIEW_KEY", Event.TYPE_KEY_EVENT);

    //收藏
    this.FAVORITE_KEY = new Event("FAVORITE_KEY", Event.TYPE_KEY_EVENT);
};

var STBEvent = new function()
{
    // 机顶盒统一事件
    this.KEY_IPTV_EVENT = new Event("Common STB Event", Event.TYPE_STB_EVENT);
    // 预览时间已到
    this.PREVIEW_TIME_END = new Event("Preview time end Event", Event.TYPE_STB_EVENT);
    // 媒体异常
    this.EVENT_MEDIA_ERROR = new Event("Media error Event", Event.TYPE_STB_EVENT);
    // 媒体播放结束
    this.EVENT_MEDIA_END = new Event("Media end Event", Event.TYPE_STB_EVENT);
    // 媒体播放开始
    this.EVENT_MEDIA_BEGINING = new Event("Media begining Event", Event.TYPE_STB_EVENT);
    // 媒体播放恢复
    this.EVENT_PLAYMODE_CHANGE = new Event("Play mode change Event", Event.TYPE_STB_EVENT);
    // 时移状态改变
    this.EVENT_PLTVMODE_CHANGE = new Event("Pltv mode change Event", Event.TYPE_STB_EVENT);
    // 切换频道
    this.EVENT_GO_CHANNEL = new Event("go to Channel", Event.TYPE_STB_EVENT);
    // PPV提醒结束
    this.EVENT_PPV_REMINDER_END = new Event("ppv end", Event.TYPE_STB_EVENT);
    // 断线重连
    this.EVENT_MEDIA_RECONNECT = new Event("stb need reconnect", Event.TYPE_STB_EVENT);
    // 频道被篡改
    this.EVENT_CHANNEL_LIST_TAMPERED = new Event('Channel list tampered', Event.TYPE_STB_EVENT);
    // CA错误
    this.EVENT_ERROR_CA = new Event('CA Error', Event.TYPE_STB_EVENT);
    // PPV开始
    this.EVENT_PPV_START = new Event('PPV Start', Event.TYPE_STB_EVENT);
    // PPV结束
    this.EVENT_PPV_REMINDER_END = new Event('PPV reminder end', Event.TYPE_STB_EVENT);
    // 通用Reminder事件
    this.EVENT_UNIVERSAL_REMINDER = new Event('Universal Reminder', Event.TYPE_STB_EVENT);
    // 机顶盒升级事件
    this.EVENT_NEW_VERSION = new Event('STB new version', Event.TYPE_STB_EVENT);
    // 机顶盒心跳事件
    this.EVENT_STB_HEARTBEAT = new Event('STB heartbeat', Event.TYPE_STB_EVENT);
    // 错误事件
    this.EVENT_STB_ERROR = new Event('STB error', Event.TYPE_STB_EVENT);
    // 错误恢复事件
    this.EVENT_STB_RESTORE = new Event('STB restore', Event.TYPE_STB_EVENT);
    // TVMS事件
    this.EVENT_TVMS = new Event('TVMS', Event.TYPE_STB_EVENT);
    // 假待机唤醒
    this.EVENT_POWEROFF_WAKEUP = new Event('PowerOff wake up', Event.TYPE_STB_EVENT);
    // PAD甩屏事件
    this.EVENT_CONTROL_SYNCTOSCREEN = new Event('Pad sync to screen', Event.TYPE_STB_EVENT);
};
